from selenium import webdriver
from time import sleep


user = 'xingfujiayuanjulebuCYDW1'
pwd = 'qqqqqq'

gsmc = '烟台市兴农国际贸易有限公司'
tysh = '913706001650403852'
zch = '370600228108884'
fr = '成龙'

driver = webdriver.Chrome()
driver.get("http://172.16.1.21/loginPage")
driver.maximize_window()

# 用户登录
driver.find_element_by_xpath("//input[@type='text']").send_keys(user)

driver.find_element_by_xpath("//input[@type='password']").send_keys(pwd)
driver.find_element_by_id("loginBtn").click()
sleep(2)
#失信信息发布
driver.find_element_by_xpath("//div[2]/div/div/div[2]/div").click()
driver.get('http://172.16.1.21/loginTouser/credit/creditPub/debtLegalPub')
sleep(2)
driver.find_element_by_css_selector("input.el-input__inner").send_keys(gsmc)
driver.find_element_by_xpath("(//input[@type='text'])[2]").send_keys(tysh)
driver.find_element_by_xpath("(//input[@type='text'])[3]").send_keys(zch)

driver.find_element_by_xpath("//div[4]/div/div/input").send_keys(fr)
driver.find_element_by_xpath('//span[3]').click()
driver.find_element_by_xpath("(//input[@type='text'])[5]").send_keys("E123456")
driver.find_element_by_xpath("(//input[@type='text'])[6]").send_keys("1583.89")
sleep(2)
driver.find_element_by_xpath("//input[@name='']").send_keys("2011-02-01 00:00:00")
sleep(2)
# driver.find_element_by_xpath("(//input[@type='text'])[6]").click()  #点击金额

driver.find_element_by_xpath("//textarea").click()
driver.find_element_by_xpath("//textarea").send_keys(gsmc+"欠款说明"+tysh)

js="var q=document.documentElement.scrollTop=10000"
driver.execute_script(js)
sleep(2)

driver.find_element_by_xpath("//td/div/label/span/span").click()
driver.find_element_by_xpath("//div[12]/div/button/span").click()



























